﻿using ASmile.DBModel;
using ASmile.Setter.DaBLL;
using ASmile.Win;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ASmile.Setter
{
    public partial class FrmUserInfoSet : FrmBaseModal
    {
        public FrmUserInfoSet()
        {
            InitializeComponent();
        }

        MainBLL BLLObj { get; } = new MainBLL();

        Sys_User CurrInfo { get; set; }

        private void FrmUserInfoSet_Load(object sender, EventArgs e)
        {
            CurrInfo = BLLObj.GetUserInfo().data;
            dcm1.SetObjectToControl(CurrInfo);
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            dcm1.GetObjectByControl(CurrInfo);
            var ret = BLLObj.SetUserInfo(CurrInfo);
            if (!ret)
            {
                ShowMessage(ret.msg);
                return;
            }
            MessageBox.Show("修改成功");
            this.DialogResult = DialogResult.OK;
        }
    }
}